home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / pbmpl91d.zip / PBMPLUS / MAN / PNMCONVO.MAN < prev    next >
Text File  |  1993-01-08  |  2KB  |  67 lines

  1.  
  2.  
  3. pnmconvol(1)               Unix Programmer's Manual               pnmconvol(1)
  4.  
  5.  
  6. NAME
  7.      pnmconvol - general MxN convolution on a portable anymap
  8.  
  9. SYNOPSIS
  10.      pnmconvol convolutionfile [pnmfile]
  11.                ---------------  -------
  12.  
  13. DESCRIPTION
  14.      Reads two portable anymaps as input.   Convolves  the  second  using  the
  15.      first, and writes a portable anymap as output.
  16.  
  17.      Convolution means replacing each pixel with a  weighted  average  of  the
  18.      nearby pixels.  The weights and the area to average are determined by the
  19.      convolution matrix.  The unsigned numbers in  the  convolution  file  are
  20.      offset  by  -maxval/2 to make signed numbers, and then normalized, so the
  21.      actual values in the convolution file are only relative.
  22.  
  23.      Here is a sample convolution file; it does a simple average of  the  nine
  24.      immediate neighbors, resulting in a smoothed image:
  25.          P2
  26.          3 3
  27.          18
  28.          10 10 10
  29.          10 10 10
  30.          10 10 10
  31.  
  32.      To see how this works, do the above-mentioned offset: 10 - 18/2 gives  1.
  33.      The possible range of values is from 0 to 18, and after the offset that's
  34.      -9 to 9.  The normalization step makes the range -1 to 1, and the  values
  35.      get  scaled  correspondingly  so they become 1/9 - exactly what you want.
  36.      The equivalent matrix for 5x5 smoothing  would  have  maxval  50  and  be
  37.      filled with 26.
  38.  
  39.      The convolution file  will  usually  be  a  graymap,  so  that  the  same
  40.      convolution  gets  applied to each color component.  However, if you want
  41.      to use a pixmap and do a different convolution to different  colors,  you
  42.      can certainly do that.
  43.  
  44. SEE ALSO
  45.      pnmsmooth(1), pnm(5)
  46.  
  47. AUTHOR
  48.      Copyright (C) 1989, 1991 by Jef Poskanzer.
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.                                13 January 1991                               1
  66.  
  67.